$(document).ready(function() {

	$('#shoutoutDialog').dialog({
		resizable : false,
		draggable : false,
		modal : true,
		closeOnEscape : true,
		autoOpen : false,
		width : 400,
		title : 'Shout Loud!',
		buttons : [ {
			text : "OK",
			click : function() {
				$(this).dialog("close");
			}
		} ]
	});

	$('#btnShoutout').button({
		enabled : true
	}).click(shoutout);

	$('#counter').countdown({
		image : 'http://dl.dropbox.com/u/21940875/nescafe/images/digits.png',
		startTime : '01:12:12:00',
		digitImages : 6,
		digitWidth : 53,
		digitHeight : 77
	});
});

function shoutout() {
	var params = $('#frmShoutOut').serialize();	
	$.post("user_gateway", params, function(responseData) {		
		$('#so-response').html(responseData);
		$('#shoutoutDialog').dialog('open');
	});
}
